package com.itheima.web.controller;


import com.itheima.domain.vo.AnalysisSummaryVo;
import com.itheima.web.manager.AnalysisManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

@RestController
public class AnalysisController {

    @Autowired
    private AnalysisManager analysisManager;

    /**
     * 查询首页概要统计
     * @return
     */
    @GetMapping("/dashboard/summary")
    public AnalysisSummaryVo summary(){
        return analysisManager.summary();
    }

    //数据统计
    @GetMapping("/dashboard/users")
    public Map statisticsData( String startDate, String endDate) throws ParseException {

        return analysisManager.statisticsData(startDate, endDate);
    }
}
